<?php
$db_member = pc_base::load_model('member_model');
?>
{template "member","header"}

<!-- header -->
<header class="header bg2 clearfix">
	<h3 class="fl"><a href="{MEMBER_PATH}" title="返回上一级"><img src="{IMG_PATH2}icon/back.png" alt="返回上一级"></a></h3>
	<span class="con">分享邀请码得学分</span>
</header>
<!-- / header -->
<div class="h_48"></div>
<div class="h_20"></div>
<!-- main -->
<main class="main">
	<div class="yqm_get margin2">
		<form action="">
			<!-- <div class="t1">我的邀请码</div>
			<input type="text" class="yqm" readonly value="{$code}"> -->
			<div class="t1">我的专属邀请地址</div>
			<input type="text" class="yqm" readonly value="{$yq_url}" style="font-size:12px;">
			<div style="text-align:center;">
				<a class="paston" href="{$yq_url}">预览我的专属页面</a>
				<!-- <input type="button" class="paston" value="邀请朋友" onclick="alert_msg('长按进行复制');"> -->
			</div>
		</form>
		<div class="tips">将您的专属邀请地址发送给朋友，好友成功注册<br>您将获得30学分，被邀请的好友将获得5学分</div>
		<!-- <div class="t1"><span>用填写邀请码可获得30学分</span></div>
		<input type="text" class="yqm" placeholder="如没有邀请码不用填写"{if $friend} readonly value="{$friend}"{/if} id="yqm-code">	
		<input type="button" class="paston" value="绑 定" id="js-yp">	 -->
	</div>
	<div class="h_20"></div>
	<div class="myyqr clearfix">
		我邀请的人
		<span>我的邀请学分：<em>{$all}</em></span>
	</div>
	<ul class="myyqrList">
{loop $arr $one}
{php $user=$db_member->pkhs($one[uuid],'userid')}
		<li class="clearfix">
			<img class="img1" src="{$user[thumb]}">
			<div class="con1 fl">成功邀请 ****{substr($user[username],4)}<em>{$one[ymdhis]}</em></div>
			<span class="fr">+{$one[price]}</span>
		</li>
{/loop}
	</ul>
</main>
<!-- / main -->
<div class="h_20"></div>
<!--弹窗-->
<div class="tanchuang"><img src="{IMG_PATH2}icon/tc1.png"></div>
<script type="text/javascript">
$(function() {
	//弹窗
	var width1 = $(window).width();
	var height1 = $(window).height();
	$(".tanchuang").css({
		height: height1 + "px",
		width: '100%'
	});
	$(".tanchuang img").click(function(){
		$(".tanchuang").fadeOut();
	});


	$('#js-yp').click(function() {
		var _code = $('#yqm-code').val();
		$.ajax({
			type: 'post',
			url: '/index.php?m=member&c=jifen&a=friendbind',
			data: {
				'code': _code
			},
			dataType: 'json',
			success: function(res) {
				console.info(res);
				if (res.status == 100) {
					alert_jifen(res.desc, res.data);
				} else {
					alert_msg(res.desc);
				}
			}
		});
	});
});
</script>

{template "member","footer"}